package com.course.web.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Min;

/**
 * Created by Justin on 2017/6/13.
 */
@Data
@EqualsAndHashCode(of = {"id"})
public class AgendaWeekVM implements HasID {
    @Min(0)
    private int id;
    @Min(0)
    private int agendaId;
    @Min(0)
    private int studentId;
    @Min(0)
    private int courseId;
    @Min(0)
    private int specId;
    @Min(0)
    private int partIdx;
    @NotEmpty
    private final String workday;
    @NotEmpty
    private final String weekend;

    private AgendaItemVM[] items = new AgendaItemVM[8];

    public AgendaItemVM getItem(int weekDay) {
        return items[weekDay];
    }

    public void setItem(int weekDay, AgendaItemVM item) {
        items[weekDay] = item;
    }
}
